﻿using FastORM.Applicaiton;
using FastORM.Enum;
using FastUtil.Config;
using System;
using System.Collections.Generic;
using System.Text;

namespace FastCore.Test.ORM
{
    public class DBUserThree
    {
        public void Insert()
        {
            CommonDao dao = new CommonDao(DataBaseClass.MySql, AppConfigUtil.Configuration["ConnectionStrings:Base_ConnectionString"]);
            string ExceptionStr = string.Empty;
            dao.ExecuteTransition(delegate ()
            {
                for (int i = 0; i < 100; i++)
                {
                    if (i == 50)
                    {
                        throw new Exception("11111");
                    }
                    Frame_User user = new Frame_User();
                    user.UserGuid = "XXXXXXThree"+i;
                    user.LoginID = "yanpeng";
                    user.Mobile = "18800001111";
                    user.Age = 18;
                    user.DisplayName = "颜鹏";
                    user.Birthday = DateTime.Now;
                    user.Gender = 1;
                    user.Introduction = "XXXXXXXXXXXXXXXXX";
                    user.Salary = 5356;
                    dao.Insert(user);
                }
            },out ExceptionStr);
          
        }
    }
}
